<?php
//======================================================================================
//
// Function: Get current URL
//
// Programmer: JJ
// Date : 2024-01-02
//
// Copyright Reeft A/S (c) - 2024
//======================================================================================
function REEFT_get_current_url()
{
$wrk_URL = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
$pgm_name = basename($_SERVER['PHP_SELF']);
// Remove current program name
$wrk_URL = str_replace($pgm_name, '', $wrk_URL);
// HTTP type
$actual_link = (empty($_SERVER['HTTPS']) ? 'http' : 'https') . "://$_SERVER[HTTP_HOST]$wrk_URL";
return $actual_link;
}
?>